package leetcode;

/**
 * @program: datastructureandalogorithm
 * @description:
 * @author: hmx
 * @create: 2022-03-01 22:19
 **/
public class LeetCode2185 {

    public int prefixCount(String[] words, String pref) {
        int ans = 0;
        for (String word : words) {
            if (word.indexOf(pref) == 0) {
                ++ans;
            }
        }
        return ans;
    }

}
